﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Cl.Utils.Extention
{
    public static class Extensions_Enum
    {
        public static string ToLimsDescription(this Enum item)
        {
            string name = item.ToString();
            var desc = item.GetType().GetField(name)?.GetCustomAttribute<DescriptionAttribute>(false);
            return desc?.Description ?? name;
        }
    }
}
